﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BookOnline.Data
{
    public class OrderDetail
    {
        private string _ODID;
        private string _OID;
        private string _BookID;
        private string _Quantity;
        private string _ODPrice;

        public string ODID { get { return _ODID; } set { _ODID = value; } }
        public string OID { get { return _OID; } set { _OID = value; } }
        public string BookID { get { return _BookID; } set { _BookID = value; } }
        public string Quantity { get { return _Quantity; } set { _Quantity = value; } }
        public string ODPrice { get { return _ODPrice; } set { _ODPrice = value; } }

        public OrderDetail OrderDetailIDataReader(IDataReader dr)
        {
            OrderDetail obj = new OrderDetail();
            obj.ODID=(dr["ODID"]is DBNull)?string.Empty:dr["ODID"].ToString();
            obj.OID = (dr["OID"] is DBNull) ? string.Empty : dr["OID"].ToString();
            obj.BookID = (dr["BookID"] is DBNull) ? string.Empty : dr["BookID"].ToString();
            obj.Quantity = (dr["Quantity"] is DBNull) ? string.Empty : dr["Quantity"].ToString();
            obj.ODPrice = (dr["ODPrice"] is DBNull) ? string.Empty : dr["ODPrice"].ToString();
            return obj;
        }
    }
}
